package com.one.controller;

import com.one.constant.RequestReturnConstant;
import com.one.constant.SystemConstant;
import com.one.util.RequestReturn;
import com.one.util.RequestReturnFactory;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName: ReturnCodeMessage
 * @Auther: yph
 * @Date: 2022/1/21 13:15
 * @Description: 统一返回状态信息
 */
@RestController
@Api(tags = "A.统一返回状态信息")
public class ReturnCodeMessage {

    /**
     * @Author: yph
     * @Date: 2022/1/21 13:16
     * @return:
     * @Description: 提供一个接口，显示所有的返回前端的状态信息
    */
    @ApiResponses({
            @ApiResponse(code = 1000,message = "成功操作"),
            @ApiResponse(code = 5000,message = "失败操作"),
            @ApiResponse(code = 5001,message = "微信未注册"),
            @ApiResponse(code = 5010,message = "验证码错误"),
            @ApiResponse(code = 5011,message = "账号密码错误"),
            @ApiResponse(code = 6001,message = "库存不足"),
            @ApiResponse(code = 6002,message = "商品不存在"),
            @ApiResponse(code = 6003,message = "用户只能抢购一次"),
            @ApiResponse(code = 6004,message = "订单生成异常"),
            @ApiResponse(code = 6005,message = "订单生成成功"),
            @ApiResponse(code = 6006,message = "下单金额不匹配"),
            @ApiResponse(code = 6007,message = "下单失败"),
            @ApiResponse(code = 6012,message = "移入收藏夹失败")
    })
    @ApiOperation(value = "统一信息返回状态码说明",notes = "后台返回状态码信息")
    @GetMapping("/returnCode")
    public RequestReturn<String> returnCode(){
        return RequestReturnFactory.success("");
    }


}
